package com.fz.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.fz.entity.Bill;
import com.fz.entity.PropertyFee;
import com.fz.service.BillService;
import com.fz.vo.ResultVo;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * 存储水电费信息 前端控制器
 * </p>
 *
 * @author hyr
 * @since 2025-06-18
 */
@RestController
@RequestMapping("/bill")
public class BillController {
    @Resource
    BillService billService;

    @PostMapping("/llist")
    public ResultVo<IPage<Bill>> list(Long userId, Integer pageNo, Integer pageSize)
    {
        return ResultVo.success(billService.getList(userId, pageNo, pageSize));

    }
    @PostMapping("/add")
    ResultVo<Boolean> add(Long userId,String type,BigDecimal amount){
        System.out.println("充值金额"+amount);
        return ResultVo.success(billService.add(userId,type,amount),"缴费成功");
    }


}
